<!DOCTYPE html>
<html>
 <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>C Programing Learning</title>
	<link rel="stylesheet" type="text/css" href="css/base.css"/>
	<link rel="stylesheet" type="text/css" href="css/ask.css"/>
	<link href="img/favour.ico" type="image/ico" rel="shortcut icon">
	<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript"><!--
$(document).ready(function(){
	$("label").click(function(){
		if(CheckCount()>4){color='red';}else{color='green';}		
		this.style.background=((document.getElementById(this.getAttributeNode("for").value).checked?false:true)? color:'');		
	});
	$("input.submit").click(function(){
		var j=CheckCount()
		//warning.innerText=CheckCount();
		if(j>5){
			document.getElementById("warning").innerHTML="<p style='color:red'>←最多选择<b>5</b>个</p>";return false;
		}else if(j==0){
			document.getElementById("warning").innerHTML="<p style='color:red'>←至少选择<b>1</b>个分类</p>";return false;
		}else{
		document.getElementById("warning").innerText="";}
				
	});
	function CheckCount(){
		var j = 0;
		var ckb = $("input.checkbox");
		for(var i=0;i<ckb.length;i++){
			if(ckb[i].checked==true){j++;}
		}
		return j;
	}
});

function checktext(text) 
{ 
	allValid = true; 
	for (i = 0; i < text.length; i++) 
	{ 
		if (text.charAt(i) != " ")
		{ 
			allValid = false; 
			break; 
		} 
	} 
	return allValid; 
}

function checkinput(message,total,used,remain) 
{
	var max; 
	max = total.value; 
	if (message.value.length > max) { 
		message.value = message.value.substring(0,max); 
		used.value = max; 
		remain.value = 0; 
	} 
	else { 
		used.value = message.value.length; 
		remain.value = max - used.value; 
	} 
}

-->
</script>
</head>
<body>
	<div id="content">
		<div id="container">
			<div id="header">
				<a class="logo" href="/" title="C Programing Learning"></a>
				<div class="nav">
					<ul>
						<li><a href="/">主页</a></li>
						<li><a href="ask.html">提问</a></li>
						<li><a href="documation.html">资源</a></li>
					</ul>
				</div>
				<div class="loginbar">				
					<span><a href="login.html?action=login">登录</a></span>
					<span><a href="register.html">注册</a></span>
				</div>
				<div>				
					<span>有两种方式构建软件设计：一种是把软件做得很简单以至于明显找不到缺陷；另一种是把它做得很复杂以至于找不到明显的缺陷。——C.A.R. Hoare</span><br/>
					<span>获得人生中的成功需要的专注与坚持不懈多过天才与机会。<br/>——C.W. Wendte</span>
				</div>
			</div><hr/>
			<div id="ask">
				<form action="ask.html" method="post">
					<p>
						<label for="title" class="describle">一句话描述您的疑问:</label><br/>
						<textarea id="title" name="title" rows="2" cols="32" wrap=PHYSICAL
								placeholder="请在这里概述您的问题"
								oninput="checkinput(this.form.title,this.form.total,this.form.used,this.form.remain);"
								onpropertychange=="checkinput(this.form.title,this.form.total,this.form.used,this.form.remain);"
									></textarea>
						<span class="count">
							<input disabled maxLength="2" name="used" size="2" value="0" class="inputused"/>/<input disabled maxLength="2" name="total" size="2" value="32" class="inputtotal"/>				 
							<input disabled maxLength="4" name="remain" size="3" value="32" class="inputremain"  
								style="display:none;"/>
						</span>
					</p> 				
					<p>
						<label for="contents" class="describle">问题补充(选填)</label><br/>
						<textarea id="contents" name="contents" rows="9" cols="32" wrap=PHYSICAL
								placeholder="在这里继续补充问题细节"
								oninput="checkinput(this.form.contents,this.form.total2,this.form.used2,this.form.remain2);" 
								onpropertychange=="checkinput(this.form.contents,this.form.total2,this.form.used2,this.form.remain2);"
									></textarea>
					</p>
					<p>
						<span class="count">
							<input disabled maxLength="4" name="used2" size="3" value="0" 
								class="inputused" style="display:none;"/>
							<input disabled maxLength="4" name="total2" size="3" value="9999" 
								class="inputtotal" style="display:none;"/>				 
							您还可以输入<input disabled maxLength="4" name="remain2" size="3" value="9999" class="inputremain"/>字
						</span>
						<span>
<ul>
<li><label class='tag0'><b>问题分类-</b></label></li>
<li><label for='tag1' class='tag'>变量</label><input id='tag1' type='checkbox' name='tag[]' value='1' class='checkbox'/></li>
<li><label for='tag2' class='tag'>输出</label><input id='tag2' type='checkbox' name='tag[]' value='2' class='checkbox'/></li>
<li><label for='tag3' class='tag'>字符串</label><input id='tag3' type='checkbox' name='tag[]' value='3' class='checkbox'/></li>
<li><label for='tag4' class='tag'>数组</label><input id='tag4' type='checkbox' name='tag[]' value='4' class='checkbox'/></li>
<li><label for='tag5' class='tag'>循环</label><input id='tag5' type='checkbox' name='tag[]' value='5' class='checkbox'/></li>
<li><label for='tag6' class='tag'>函数</label><input id='tag6' type='checkbox' name='tag[]' value='6' class='checkbox'/></li>
<li><label for='tag7' class='tag'> 类 </label><input id='tag7' type='checkbox' name='tag[]' value='7' class='checkbox'/></li>
<li><label for='tag8' class='tag'>对象</label><input id='tag8' type='checkbox' name='tag[]' value='8' class='checkbox'/></li>
<li><label for='tag9' class='tag'>指针</label><input id='tag9' type='checkbox' name='tag[]' value='9' class='checkbox'/></li>
<li><label for='tagA' class='tag'>算法</label><input id='tagA' type='checkbox' name='tag[]' value='A' class='checkbox'/></li>
<li><label for='tagB' class='tag'>数学</label><input id='tagB' type='checkbox' name='tag[]' value='B' class='checkbox'/></li>
<li><label for='tagC' class='tag'>编译</label><input id='tagC' type='checkbox' name='tag[]' value='C' class='checkbox'/></li>
<li><label for='tagD' class='tag'>排序</label><input id='tagD' type='checkbox' name='tag[]' value='D' class='checkbox'/></li>
<li><label for='tagE' class='tag'>运行</label><input id='tagE' type='checkbox' name='tag[]' value='E' class='checkbox'/></li>
<li><label for='tagF' class='tag'>转换</label><input id='tagF' type='checkbox' name='tag[]' value='F' class='checkbox'/></li>
<li><label id="warning"></label></li>
</ul>

						</span>
						<hr class="clear"/>
						<span><input type="submit" value="提问" class="submit"/></span>
						
					</p>
				</form>
			</div>
		</div>
		<div id="footer">
			<!-- <div><a href="#">url</a><a href="#">url</a><a href="#">url</a><a href="#">url</a></div>-->		
		</div>	
	</div>
</body>
</html>